import resquest from '@/utils/request'
export const getRoleList = params => {
  return resquest({
    url: '/sys/role',
    method: 'get',
    params
  })
}
// 新增角色
export const addRole = data => {
  return resquest({
    url: '/sys/role',
    method: 'post',
    data
  })
}
// 获取角色详情
export const getRoleDetail = id => {
  return resquest({
    url: `/sys/role/${id}`,
    method: 'get'
  })
}
// 修改角色
export const updateRole = data => {
  return resquest({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
export const delRole = id => {
  return resquest({
    url: `/sys/role/${id}`,
    method: 'delete'

  })
}

// 获取可用角色列表
export const getRoleListAll = () => {
  return resquest({
    url: '/sys/role/list/enabled',
    method: 'get'
  })
}
// 分配权限-角色 roleIds
export const assignPerm = data => {
  return resquest({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}

